00001 // ********************************************************* 00002 // Setup contains the loading of major files and setup of game enviroment. 00003 // also creates all the objects and units for the game. 00004 // ********************************************************* 00005 00006 00007 //dbMaximizeWindow (); 00008 00009 //load all the sounds 00010 dbLoadSound("Ding2.wav",1001); 00011 dbLoadSound("Press2.wav",1000); 00012 00013 player=gold; 00014 #include "oldMenu.h" // code that has been commented out 00015 00016 dbChangeMouse(1); 00017 dbColorBackdrop(0); 00018 00019 //load gun sounds 00020 dbLoadSound("Gun 2.wav",3); 00021 dbLoadSound("Cannon.wav",4); 00022 dbLoadSound("Boom 2.wav",9); 00023 dbLoadSound("Jet Flyby 2.wav",1002); 00024 00025 dbLoadSound("subm1.wav",200); 00026 dbLoadSound("subm2.wav",201); 00027 dbLoadSound("subm3.wav",202); 00028 dbLoadSound("subm4.wav",203); 00029 00031 //dbLoadImage( 00032 //"building1.bmp", 30005); 00033 00034 //dbLoadImage( 00035 //"building1roof.bmp", 30007); 00036 00037 //dbLoadImage( 00038 //"building2.bmp", 30008); 00039 00040 //dbLoadImage( 00041 //"building2roof.bmp", 30009); 00042 00043 //dbLoadImage( 00044 //"building300.bmp", 30010); 00045 00046 //dbLoadImage( 00047 //"building300roof.bmp", 30011); 00048 00049 //dbLoadImage( 00050 //"building4.bmp", 30012); 00051 00052 //dbLoadImage( 00053 //"building4roof.bmp", 30013); 00054 00055 //int builTex[6]; 00056 00057 //builTex[0] = 30005; 00058 00059 //builTex[1] = 30005; 00060 00061 //builTex[2] = 30008; 00062 00063 //builTex[3] = 30010; 00064 00065 //builTex[4] = 30012; 00066 00067 //builTex[5] = 30012; 00068 00069 //int roofTex[6]; 00070 00071 //roofTex[0] = 30007; 00072 00073 //roofTex[1] = 30007; 00074 00075 //roofTex[2] = 30009; 00076 00077 //roofTex[3] = 30011; 00078 00079 //roofTex[4] = 30013; 00080 00081 //roofTex[5] = 30013; 00082 00083 //Make the Ground 00084 00085 dbLoadImage("ground.jpg",10000); 00086 00087 dbLoadImage("road.bmp", 3); 00088 00089 dbMakeMatrix(1,3000,3000,10,10); 00090 00091 dbRandomizeMatrix(1,3); 00092 00093 //dbPositionMatrix(30000,-500,-10,-500); //DELETE -10 WHEn FINISH 00094 00095 dbPositionMatrix(1,-500,-5,-500); 00096 00097 dbPrepareMatrixTexture(1,10000,1,1); 00098 00099 //=============================== 00100 //Will use object ids from 30020 to 30040 for buildings and their roofs 00101 //===================== 00102 00107 00108 //BuildingN building; 00109 //for (int xx=30020; xx< 30079; xx++) 00110 //building.NewBuilding(xx, xx+80, (rand() % 70) , rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00111 // 00112 //building.NewBuilding(30022, 30023, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]); 00113 // 00114 //building.NewBuilding(30024, 30025, (rand() % 70) , rand()%(400) , -rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]); 00115 00116 //building.NewBuilding(30026, 30027, (rand() % 70) , -rand()%(400) , -rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00117 00118 //building.NewBuilding(30028, 30029, (rand() % 70) , rand()%(400) , -rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]); 00119 00120 //building.NewBuilding(30030, 30031, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00121 00122 //building.NewBuilding(30032, 30033, (rand() % 70) , rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00123 00124 //building.NewBuilding(30034, 30035, (rand() % 70) ,- rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00125 00126 //building.NewBuilding(30036, 30037, (rand() % 70) , -rand()%(400) , -rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00127 00128 //building.NewBuilding(30038, 30039, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]); 00129 00130 //----------------------------------------------------- 00131 //CHANGE MUSIC 00132 //dbStopMusic(m_title); 00133 //dbLoopMusic(m_idle); 00134 00135 00136 //LISA's models 00137 //dbLoadObject("MilitaryBase3DS.3DS",100); 00138 //dbLoadImage("military base texture version21.jpg", 1000); 00139 //dbScaleObject(100, 1000,1000,1000); 00140 //dbPositionObject(100, 100,0,100); 00141 //dbTextureObject(100,1000); 00142 00143 //LISA's models ---TAKES TOO LONG TO LOAD 00144 //dbLoadObject("Dragon Unit 3DS.3DS",1000); 00145 //dbLoadImage("Dragon 5.jpg", 1000); 00146 //dbScaleObject(100, 1000,1000,1000); 00147 //dbPositionObject(100, 100,0,100); 00148 //dbTextureObject(100,1000); 00149 00150 // //LISA's models ---TAKES TOO LONG TO LOAD 00151 //dbLoadObject("Gemstone Mine 3DS.3DS",102); 00152 //dbLoadImage("Gemstone Mine Texture 8.jpg", 1002); 00153 //dbScaleObject(102, 1000,1000,1000); 00154 //dbPositionObject(102, 100,0,-100); 00155 //dbTextureObject(102,1002); 00156 00157 //LISA's models 00158 //dbLoadObject("Oil Derek.3DS",103); 00159 //dbLoadImage("oil rig texture version 3.jpg", 1003); 00160 //dbScaleObject(103, 2000,1000,1000); 00161 //dbPositionObject(103, 100,0,100); 00162 //dbTextureObject(103,1003); 00163 00164 // dbLoadObject("TownCenter3DS.3DS",104); 00165 //dbLoadImage("TownCenterTextureVersion21.jpg", 1004); 00166 //dbScaleObject(104, 1000,1000,1000); 00167 //dbPositionObject(104, 100,0,100); 00168 //dbTextureObject(104,1004); 00169 00170 // turn on sync rate and set maximum rate to 60 fps 00171 dbSyncOn ( ); 00172 dbSyncRate ( 60 ); 00173 00174 //create bullets 00175 for (int xx=bullNumStart; xx< bullNumEnd; xx++) { 00176 00177 dbMakeObjectSphere(xx,1); 00178 dbSetObjectLight(xx,0); 00179 O[xx][L]=1; 00180 00181 } 00182 00183 dbAutoCamOff(); 00184 00185 //create selecter object 00186 dbMakeObjectSphere(1,5); 00187 00188 //set up camera 00189 dbPositionCamera(50,100,50); 00190 dbPointCamera(50,0,100); 00191 00192 //create planes 00193 planeEnv planeenv; 00194 //tour planes 00195 for (int xx=tourPlaneStart; xx< tourPlaneEnd; xx++) { 00196 planeenv.newTourPlane(xx); 00197 00198 O[xx][L]=1; 00199 00200 } 00201 00202 //creata all vehicles, respective of their teams 00203 Vehicle veh; 00204 for (int x=100; x<103; x++){ 00205 if (player==gold) { 00206 veh.NewVehicle(gold, 34); 00207 00208 //enemy 00209 //if (dbRND(1)==1) 00210 veh.NewVehicle(red, 54); 00211 veh.NewVehicle(red,56); 00212 00213 //building 00214 veh.NewVehicle(gold, 31); 00215 veh.NewVehicle(gold, 31); 00216 00217 //enemy building 00218 veh.NewVehicle(red, 50); 00219 veh.NewVehicle(red, 50); 00220 veh.NewVehicle(red, 50); 00221 veh.NewVehicle(red, 50); 00222 } 00223 00224 //debug problems 00225 //if (player==red) { 00226 // veh.NewVehicle(red, 54); 00227 00228 // //enemy 00229 // //if (dbRND(1)==1) 00230 // veh.NewVehicle(gold, 34); 00231 // veh.NewVehicle(gold, 36); 00232 00233 // //building 00234 // veh.NewVehicle(red, 50); 00235 // veh.NewVehicle(red, 50); 00236 00237 // veh.NewVehicle(gold, 30); 00238 // veh.NewVehicle(gold, 30); 00239 00240 // veh.NewVehicle(gold, 30); 00241 // veh.NewVehicle(gold, 30); 00242 00243 //} 00244 00245 } 00246 00247 00248 00249 00250 00251 00252 //dbLoadObject("TOYSHOP.x",3);
1.5.8